package xian.woniuxy.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import xian.woniuxy.dao.GoodsMapper;
import xian.woniuxy.entity.Goods;
import xian.woniuxy.service.IGoodsService;

import java.util.List;

/**
 * @author ljy
 * @time 2021/12/25 13:10:57
 */
@Service
@Transactional
public class GoodsServiceImpl implements IGoodsService {

    @Autowired
    GoodsMapper goodsMapper;

    @Override
    public void save(Goods goods) {
        goodsMapper.save(goods);
    }

    @Override
    public void delete(int goods_id) {
        goodsMapper.delete(goods_id);
    }

    @Override
    public void update(Goods goods) {
        goodsMapper.update(goods);
    }

    @Override
    public List<Goods> getAll() {
        return goodsMapper.getAll();
    }

    @Override
    public Goods getOne(int id) {
        return goodsMapper.getOne(id);
    }

    @Override
    public List<Goods> getByName(String name) {
        return goodsMapper.getByName(name);
    }
}
